package com.tjw.ec.upms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tjw.ec.common.core.util.PageUtils;
import com.tjw.ec.common.core.util.Query;
import com.tjw.ec.upms.api.entity.CompanyEntity;
import com.tjw.ec.upms.dao.CompanyDao;
import com.tjw.ec.upms.service.CompanyService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 公司表
 *
 * @author T-junwen
 * @email t-junwen@foxmail.com
 * @date 2019-07-27 16:43:32
 */
@Service("companyService")
public class CompanyServiceImpl extends ServiceImpl<CompanyDao, CompanyEntity> implements CompanyService {

    @Override
    public PageUtils<CompanyEntity> queryPage(Map<String, Object> params) {

        IPage<CompanyEntity> page = new Query<CompanyEntity>(params).getPage();

        QueryWrapper<CompanyEntity> queryWrapper = new QueryWrapper<>();

        IPage<CompanyEntity> data = baseMapper.selectPage(
                page,
                queryWrapper
        );

        return new PageUtils(data);
    }

}
